package com.tqjc.business.interactivewithscan.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tqjc.business.interactivewithscan.entity.UfcDeviceInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author
 * @since 2021-12-21
 */
public interface UfcDeviceInfoMapper extends BaseMapper<UfcDeviceInfo> {
    /**
     * 通过设备编码查询设备信息
     *
     * @param deviceCode
     * @return
     */
    @Select("SELECT info.* FROM ufc_device_info info WHERE info.device_oid = (SELECT id FROM scan_device_data WHERE device_code = #{deviceCode})")
    UfcDeviceInfo queryByCode(@Param("deviceCode") String deviceCode);

    /**
     * @param tankerTaskOid
     * @return
     */
    UfcDeviceInfo queryByTankerTaskOid(@Param("tankerTaskOid") Long tankerTaskOid);
}
